import { ChatRoom } from "../type/entity";
import { http } from "../util/http";


export function createChatRoom(name: string){
  return http.post<ChatRoom>('/createChatRoom', {name})
}

export function getChatRooms(){
  return http.post<ChatRoom[]>('/getChatRooms')
}

export function getChatRoomById(id: string){
  return http.post<ChatRoom>('/getChatRoomById', {id})
}

export function removeChatRoom(id: string){
  return http.post<{success:boolean}>('/removeChatRoom', {id})
}